import React from "react";
import { ListRawState } from "../../views/home";
import './style.scss'
interface PropsType {
  v: ListRawState;
  onClick?: () => void;
	preLeft?: JSX.Element | React.ReactElement | React.ReactNode 
  desc?: JSX.Element | React.ReactElement | React.ReactNode 
}

const ListItem: React.FC<PropsType> = ({ v, onClick, preLeft, desc }) => {
  return (
    <div>
      <dl className="list-item" onClick={onClick}>
        <dt>
					{ preLeft }
          <img src={v.image[0]} alt="" />
        </dt>
        <dd>
          <h3>{v.title}</h3>
          { desc }
          <p className="price">￥：{v.price}</p>
        </dd>
      </dl>
    </div>
  );
};

export default ListItem;
